package site.hanzhe.did.entity;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 架构实体类
 *
 * @author 张涵哲
 * @since 2024-06-14 19:38:53
 */
@Getter
@Setter
@NoArgsConstructor
public class Platform {

    private String os;
    private String arch;
    private String variant;

    private String digest;

    public Platform(String os, String arch) {
        this.os = os;
        this.arch = arch;
    }

    @Override
    public String toString() {
        String string = StrUtil.join("/", os, arch);
        if (StrUtil.isNotBlank(variant)) {
            string += "/" + variant;
        }
        return string;
    }

}
